package com.wang.di.defalut.anno_executor;

import com.wang.di.core.JustDI;
import com.wang.di.core.handler.AnnoHandler;
import com.wang.di.defalut.anno.DI;

import java.lang.reflect.Field;

public class DIExecutor extends AnnoHandler<DI> {
    private JustDI justDI;

    public DIExecutor(JustDI justDI) {
        this.justDI = justDI;
    }

    @Override
    public Object field(Object instance, Class<?> clz, Field field, DI anno) throws Exception {
        return justDI.get(field.getType(), field.getName());
    }
}
